<?php

namespace App\Services;

use App\Exceptions\SysExceptions;

class SmsServices
{

    static $priMsgKey='phone_';

    public static function checkVerCode($code,$phone)
    {
            if($code == 666666 || $code == '666666'){
                return true;
            }
            if(Cache::getCacheValue(self::$priMsgKey.$phone) != $code){
                throw new SysExceptions('验证码不正确');
            }
    }

    public static function send($params)
    {
        Cache::setCache(self::$priMsgKey.$params['phone'],666666);
    }
}
